// pages/fabu_management/fabu_management.js
const app = getApp(), core = require('../../utils/core'),chatIM = require('../../utils/websocket.js');
Page({

  /**
   * 页面的初始数据
   */
  data: {
    receive_user_id:0,
    query: {type:0, status:1},
    array: ['全部','急招', '直招', '店铺招聘', '红包招聘'],
    show:true,
    jobs: [],
    showPromoteTip: false,
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.setData({receive_user_id:options.receive_user_id})
    this.refresh();
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  },
  refresh: function () {
    this.setData({jobs:[]});
    core.get({
      url: '/xilujob.job_manage/index', data: this.data.query, success: ret => {
        this.setData({jobs: ret.data.jobs, jobCount: ret.data.job_count, jobLimit: ret.data.job_limit});
      }
    });
  },
  bindSendJob(e){
	let jobId = e.currentTarget.dataset.id;
	chatIM.sendMessage(this.data.receive_user_id, jobId,3);
	wx.navigateBack();
}
});
